<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('operate_logs', function (Blueprint $table) {
            $table->id();
            $table->foreignId('user_id');
            $table->string('path', 255)->comment('请求路径');
            $table->string('method', 10)->comment('请求方法');
            $table->string('ip', 20)->comment('请求ip');
            $table->text('input')->comment('请求参数');
            $table->text('output')->comment('响应参数');
            $table->integer('status')->comment('状态码');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('operate_logs');
    }
};
